package fonkin.com.wifisignapp.utils;


import com.google.gson.Gson;

import java.io.Serializable;

/**
 * 返回值的封装
 * @author 黄洪靖
 *
 * @param <T>
 */
public class SimpleReturnVo<T> implements Serializable{
	/**
	 * 返回状态码 100表示请求到数据， 101请求失败
	 */
	private String code;
	//返回的数据
	private T data;
	//返回的消息
	private String msg;

	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public T getData() {
		return data;
	}
	public void setData(T data) {
		this.data = data;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}




	@Override
	public String toString(){
		Gson gson = new Gson();

		return "SimpleReturnVo{" +
				"code='" + code + '\'' +
				", data=" + gson.toJson(data).toString() +
				", msg='" + msg + '\'' +
				'}';
	}
}
